#include "base/debug.h"

namespace sangame {
namespace base {

TimeKeeper::TimeKeeper( std::string& title ) : title_(title)
{
#ifdef _DEBUG
    tick_ = GetTickCount();
    std::string str = title_ + " start\n";
    OutputDebugString(string_cast<UnicodeString, AnsiString>(str).c_str());
#endif
}

TimeKeeper::~TimeKeeper()
{
#ifdef _DEBUG
	int during = GetTickCount() - tick_;
	std::string str = title_ + "finish, time spent = " + to_string<AnsiString>(during) + "(ms)\n";
	OutputDebugString(string_cast<UnicodeString, AnsiString>(str).c_str());
#endif
}

}
}